import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
import { useState, useCallback, useEffect } from "react";
import Home from "./views/home";
import File from "./views/file";
import About from "./views/About";
import Msg from "./views/msg";
import Artice from "./views/Artice";
import Workce from "./views/workce";
import Student from "./views/student";
import All from "./views/wzchild/wz_all";
import Web from "./views/wzchild/wz_web";
import Linx from "./views/wzchild/wz_linux";
import Lq from "./views/wzchild/wz_lq";
import Read from "./views/wzchild/wz_read";
import Apps from "./views/wzchild/wz_app";
import News from "./views/wzchild/wz_news";
function App() {
  let [headerflag, setheaderflag] = useState(false);
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Home></Home>}>
          <Route path="/" element={<Navigate to="/article"></Navigate>}></Route>
          <Route path="/" element={<Artice flag={headerflag}></Artice>}>
            {/* 二级路由 */}

            <Route index element={<All></All>}></Route>
            <Route path="web" element={<Web></Web>}></Route>
            <Route path="app" element={<Apps></Apps>}></Route>
            <Route path="read" element={<Read></Read>}></Route>
            <Route path="linux" element={<Linx></Linx>}></Route>
            <Route path="lq" element={<Lq></Lq>}></Route>
            <Route path="news" element={<News></News>}></Route>
          </Route>
          <Route path="File" element={<File></File>}></Route>
          <Route path="About" element={<About></About>}></Route>
          <Route path="Msg" element={<Msg></Msg>}></Route>
          <Route path="Workce" element={<Workce></Workce>}></Route>
        </Route>
        <Route path="/student" element={<Student></Student>}></Route>
      </Routes>
    </BrowserRouter>
  );
}
export default App;
